<!--
 * @Description: 
 * @Author: 张文韬
 * @Date: 2024-06-25 14:50:05
 * @LastEditTime: 2024-07-10 16:41:17
 * @LastEditors: 张文韬
 * @Reference: 
-->
<template>
  <div class="p-3 box-border bg-white">
    <SectionTitle title="基本信息">
      <!-- <template #right>
        <a v-if="curProduct.productCode" class="text-color-#409eff" target="_blank" :onclick="showProduct">产品详情</a>
      </template> -->
    </SectionTitle>
    <InsuranceContent @updateProduct="updateProduct" />

    <SectionTitle title="保险方案" />
    <SectionTable
      class="mt-15px"
      :data="curProduct"
      :columns="columns"
      :pageData="pageData"
    ></SectionTable>
    <!-- <el-collapse  v-model="activeNames">
      <el-collapse-item name="intro">
        <template #title>
          <SectionTitle title="基本信息">
          </SectionTitle>
        </template>
        <InsuranceContent @updateProduct="updateProduct" />
      </el-collapse-item>
      <el-collapse-item name="data">
        <template #title>
          <SectionTitle title="保险方案" />
        </template>
        <el-card shadow="hover">
          <SectionTable
            :data="curProduct"
            :columns="columns"
            :pageData="pageData"
          ></SectionTable>
        </el-card>
      </el-collapse-item>
    </el-collapse> -->
  </div>
  
</template>

<script setup>

import SectionTitle from '@/components/SectionTitle/index.vue'
import SectionTable from '../../components/SectionTable/index.vue'
import InsuranceContent from '../../components/InsuranceContent/index.vue'
import columns from './columns'

const activeNames = ['intro', 'data']

const pageData = ref({
  pageShow: false,
  currentPage: 1,
  pageSize: 10,
})

const curProduct = ref({})

const updateProduct = (product) => {
  curProduct.value = product
}

const showProduct = () => {
  // downBlobFile(`/admin/sys-file//${curProduct.value.code}_产品详情.pdf`, null, `${curProduct.value.code}_产品详情.pdf`)
  window.open(`https://beibaoxin.dsibc.com/file/${curProduct.value.productCode}_产品详情.pdf`)
}

onMounted(async() => {
  console.log('onMounted');
})

</script>

<style lang="scss" scoped>
  :deep(.mark-color) {
    background-color: bisque;
  }
</style>